using System;

namespace PetShop.Domain.Model
{

	
	
	
	[Serializable]
	public class CartItemInfo {

		
		
		private int _quantity = 1;
		
        private ItemEntity _item = null;
	

        public string ItemId
        {
            get { return _item.Id; }
        }

    


        public CartItemInfo(ItemEntity item, int qty)
        {
		
			this._item = item;
		
			this._quantity = qty;
		
		}

		
		public int Quantity {
			get { return _quantity; }
            set { _quantity = value; }
			
		}

		public bool InStock {
            get { return _item.IsThereEnoughInStock(_quantity); }
			
		}

		public decimal Subtotal {
            get { return (decimal)(this._quantity * this._item.ListPrice); }
		}

        public ItemEntity Item
        {
			get { return _item; }
		}

		public string Name {
            get { return _item.Id; }
		}

		public decimal Price {
            get { return _item.ListPrice; }
		}
	}
}